package cn.kgc.web;

import cn.kgc.entity.Product;
import cn.kgc.service.ProService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/pro")
public class ProController {

    @Autowired
    private ProService proService;

    @GetMapping("/list")
    public PageInfo<Product> showProList(String productName,
                                         @RequestParam(defaultValue = "1") Integer pageId){

        return proService.findProList(productName,pageId);
    }

}
